/* 新增好友模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background-color: white;
    border-radius: 10px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #cceaf2;
    border-bottom: 1px solid #99dbd1;
}

.modal-header h3 {
    color: #333;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: #7eb3b7;
    cursor: pointer;
    font-size: 16px;
}

.modal-body {
    padding: 20px;
}

.search-user {
    display: flex;
    margin-bottom: 15px;
    gap: 10px;
}

.search-user input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #99dbd1;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.search-user input:focus {
    border-color: #7eb3b7;
    box-shadow: 0 0 0 2px rgba(126, 179, 183, 0.2);
}

.search-user button {
    background-color: #7eb3b7;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.search-user button:hover {
    background-color: #99dbd1;
}

.search-results-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.user-search-result {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    background: white;
    transition: background-color 0.2s;
}

.user-search-result:hover {
    background-color: #f5f9fa;
}

.user-search-result:last-child {
    border-bottom: none;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7eb3b7, #99dbd1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.user-id {
    font-size: 12px;
    color: #7a9a9a;
}

.add-friend-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.friend-reason-input {
    padding: 6px 10px;
    border: 1px solid #99dbd1;
    border-radius: 4px;
    font-size: 12px;
    width: 150px;
    outline: none;
}

.friend-reason-input:focus {
    border-color: #7eb3b7;
}

.add-friend-btn {
    padding: 6px 12px;
    background: #7eb3b7;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: background-color 0.3s;
}

.add-friend-btn:hover {
    background: #99dbd1;
}

/* 好友请求项样式 - 更新布局 */
.friend-request-item {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border-bottom: 1px solid #e8f4f8;
    transition: all 0.3s ease;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #fffdf1;
    box-shadow: 0 2px 10px rgba(126, 179, 183, 0.1);
    border-left: 4px solid #7eb3b7;
    position: relative;
}

.friend-request-item:hover {
    background: linear-gradient(135deg, #fffdf1 0%, #cceaf2 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(126, 179, 183, 0.2);
}

/* 用户头像圆圈 */
.request-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7eb3b7 0%, #99dbd1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fffdf1;
    font-weight: bold;
    font-size: 24px;
    margin-right: 16px;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(126, 179, 183, 0.3);
}

/* 内容区域 - 重新布局 */
.request-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 用户信息区域 - 调整位置 */
.request-user-info {
    margin-bottom: 15px;
    position: relative;
    padding-top: 5px; /* 使姓名显示在圆圈右上方 */
}

.request-username {
    font-weight: 600;
    color: #5a7d7f;
    font-size: 18px;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.request-reason {
    color: #7eb3b7;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

/* 按钮容器 - 水平排列在用户信息下方 */
.request-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
}

/* 接受按钮样式 */
.accept-btn {
    background: linear-gradient(135deg, #7eb3b7, #99dbd1);
    color: #fffdf1;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(126, 179, 183, 0.3);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
    max-width: 120px;
}

.accept-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(126, 179, 183, 0.4);
    background: linear-gradient(135deg, #6fa8ac, #8bc9bf);
}

.accept-btn:active {
    transform: translateY(0);
}

/* 忽略按钮样式 - 改为填充背景，与接受按钮一致 */
.ignore-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: #fffdf1;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(255, 107, 107, 0.3);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
    max-width: 120px;
}

.ignore-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    background: linear-gradient(135deg, #ff5252, #e53935);
}

.ignore-btn:active {
    transform: translateY(0);
}

.request-time {
    color: #99dbd1;
    font-size: 12px;
    font-weight: 500;
    position: absolute;
    top: 20px;
    right: 20px;
}

/* 无请求时的样式 */
.no-requests {
    text-align: center;
    padding: 60px 20px;
    color: #7eb3b7;
    background: #fffdf1;
    border-radius: 12px;
    border: 2px dashed #cceaf2;
}

.no-requests i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.7;
    color: #99dbd1;
}

.no-requests p {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.no-requests .sub-text {
    font-size: 14px;
    margin-top: 8px;
    color: #7eb3b7;
    opacity: 0.8;
}

/* 好友请求模态框头部样式调整 */
#friend-requests-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #cceaf2;
    background: linear-gradient(135deg, #7eb3b7 0%, #99dbd1 100%);
    color: #fffdf1;
    border-radius: 12px 12px 0 0;
}

#friend-requests-modal .modal-header h3 {
    margin: 0;
    font-weight: 600;
    font-size: 20px;
    letter-spacing: 0.5px;
    color: #fffdf1;
}

/* 关闭按钮样式 */
.close-modal {
    background: rgba(255, 253, 241, 0.2);
    border: none;
    color: #fffdf1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: rgba(255, 253, 241, 0.3);
    transform: rotate(90deg);
}

/* 刷新按钮样式 */
.refresh-btn {
    background: rgba(255, 253, 241, 0.2);
    border: none;
    color: #fffdf1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.refresh-btn:hover {
    background: rgba(255, 253, 241, 0.3);
    transform: rotate(180deg);
}

/* 好友请求列表容器 */
.friend-requests-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 24px;
    background: linear-gradient(135deg, #f8fdfd 0%, #fffdf1 100%);
}

/* 滚动条样式 */
.friend-requests-list::-webkit-scrollbar {
    width: 8px;
}

.friend-requests-list::-webkit-scrollbar-track {
    background: #cceaf2;
    border-radius: 4px;
}

.friend-requests-list::-webkit-scrollbar-thumb {
    background: #7eb3b7;
    border-radius: 4px;
}

.friend-requests-list::-webkit-scrollbar-thumb:hover {
    background: #6fa8ac;
}

/* 模态框整体样式 */
.modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(126, 179, 183, 0.2);
    border: 1px solid #cceaf2;
}

.modal-overlay {
    background: rgba(204, 234, 242, 0.8);
}

/* 加载动画 */
.friend-request-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.friend-request-item.loading .request-actions button {
    opacity: 0.6;
}

/* 徽章样式 */
.notification-badge {
    background: linear-gradient(135deg, #ff0000, #db9999);
    color: #fffdf1;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(126, 179, 183, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .friend-request-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
    
    .request-avatar {
        margin-bottom: 12px;
    }
    
    .request-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 12px;
    }
    
    .request-content {
        width: 100%;
    }
    
    .request-time {
        position: static;
        margin-top: 8px;
    }
}

/* 无结果消息样式 */
.no-results {
    text-align: center;
    color: #7a9a9a;
    padding: 20px;
    font-style: italic;
}

.search-loading {
    text-align: center;
    color: #7a9a9a;
    padding: 20px;
}

/* 响应式调整 */
@media (max-width: 576px) {
    .add-friend-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .friend-reason-input {
        width: 120px;
    }
    
    .user-search-result {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .add-friend-section {
        width: 100%;
        justify-content: flex-end;
    }
}

/* 调试样式 - 确保搜索结果可见 */
.search-results {
    display: block !important; /* 强制显示 */
    opacity: 1 !important;
    visibility: visible !important;
}

.user-result-item {
    background: #7eb3b7 !important;
    border: 2px solid #007bff !important; /* 添加边框便于识别 */
    margin: 10px 0 !important;
    padding: 15px !important;
}

/* 确保模态框可见 */
.modal-overlay:not(.hide) {
    display: flex !important;
}

.modal {
    display: block !important;
}

/* 确保添加好友模态框中的元素样式正确 */
#add-friend-results {
    display: block !important;
}

.user-result-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.user-result-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.refresh-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s;
    margin-right: 10px;
}

.refresh-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}